postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------- Foreign Scan on test_csv (cost=0.00..2158874.49 rows=94056 width=52) (actual time=0.353..17566.875 rows=200000 loops=1) Filter: ((id % 100) = 56) Rows Removed by Filter: 19800000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 1.202 ms Execution time: 17573.572 ms (7 rows) postgres=# SET max_parallel_degree = 1; SET postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=1.756..18085.642 rows=400000 loops=1) Number of Workers: 1 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.300..18020.790 rows=200000 loops=2) Filter: ((id % 100) = 56) Rows Removed by Filter: 19800000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.143 ms Execution time: 18098.070 ms (9 rows) postgres=# SET max_parallel_degree = 2; SET postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.835..18663.106 rows=400000 loops=1) Number of Workers: 2 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.513..14600.749 rows=133333 loops=3) Filter: ((id % 100) = 56) Rows Removed by Filter: 13200000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.134 ms Execution time: 18676.078 ms (9 rows) postgres=# SET max_parallel_degree = 3; SET postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.824..18817.112 rows=400000 loops=1) Number of Workers: 3 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.511..12731.459 rows=100000 loops=4) Filter: ((id % 100) = 56) Rows Removed by Filter: 9900000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.120 ms Execution time: 18830.597 ms (9 rows) postgres=# SET max_parallel_degree = 4; SET postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.851..21002.776 rows=400000 loops=1) Number of Workers: 4 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=4.608..13590.657 rows=80000 loops=5) Filter: ((id % 100) = 56) Rows Removed by Filter: 7920000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.133 ms Execution time: 21015.842 ms (9 rows) postgres=# SET max_parallel_degree = 5; SET postgres=# explain analyze select * from test_csv where id % 100 = 56; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.878..22852.304 rows=400000 loops=1) Number of Workers: 5 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=11.043..14634.342 rows=66667 loops=6) Filter: ((id % 100) = 56) Rows Removed by Filter: 6600000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.122 ms Execution time: 22865.496 ms (9 rows)